﻿Imports System.Text.RegularExpressions

Public Class InputFilters
    Public Shared Sub NumbersOnly(ByVal sender As Object, ByVal e As TextCompositionEventArgs)
        e.Handled = Regex.Match(e.Text, "[^0-9-]+").Success
    End Sub

    Public Shared Sub DecimalOnly(ByVal sender As Object, ByVal e As TextCompositionEventArgs)
        e.Handled = Regex.Match(e.Text, "[^0-9.-]+").Success
    End Sub

    Public Shared Sub DateCharactersOnly(ByVal sender As Object, ByVal e As TextCompositionEventArgs)
        e.Handled = Regex.Match(e.Text, "[^0-9.:/\\PAMpam]+").Success
    End Sub
End Class
